
<html>

    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Report Input</title>
        <style type="text/css">
            body     { font-family: "Times New Roman";
                       color: black;
            }
            h1       { font-family: "Times New Roman";
                       color: blue; }
        </style>
    </head>
    <body background="xp-purple.jpg">

        <%
            model.DataBaseConnection conn = new model.DataBaseConnection();
        %>
        <%
            String soal = request.getParameter("soal");
            String pilihanA = request.getParameter("pilihanA");
            String pilihanB = request.getParameter("pilihanB");
            String pilihanC = request.getParameter("pilihanC");
            String pilihanD = request.getParameter("pilihanD");
            String no = request.getParameter("no");

            try {
                String insert = "update tablesoal set soal = '" + soal + "', pilihanA = '" + pilihanA
                        + "', pilihanB = '" + pilihanB + "', pilihanC = '" + pilihanC
                        + "', pilihanD = '" + pilihanD + "'"
                        + "where no = '" + no + "'";

                java.sql.Statement statement = conn.getConnection().createStatement();
                int OK = statement.executeUpdate(insert);
                if (OK != 0) {
        %>

        <strong>UPDATE SUKSES!!!</strong>
        <br><br>
        <%try {

                String query = "select * from tablesoal";
                java.sql.ResultSet result = statement.executeQuery(query);
        %>

        <%
                statement.close();
            } catch (Exception ex) {
                System.out.println("message: " + ex.getMessage());
            }
        } else {%>
        <strong>UPDATE GAGAL!!!</strong>
        <%}
                statement.close();
            } catch (Exception ex) {
                out.println("message: " + ex.getMessage());
            }
        %>
        <a href="staffInsert.jsp">Input Again..!!!</a>
        <input type="submit" value="Balik">
    </form>
</body>
</html>


